Skip to content

fix: Color parsing supports hex strings without hash [135]#138

Merged
lanesawyer merged 2 commits into
AllenInstitute:mainfrom
lanesawyer:lane/135-more-flexible-color-parser
Apr 28, 2025
Merged

fix: Color parsing supports hex strings without hash [135]#138
lanesawyer merged 2 commits into
AllenInstitute:mainfrom
lanesawyer:lane/135-more-flexible-color-parser

Conversation

@lanesawyer

Copy link
Copy Markdown
Collaborator

What

Fixes #135.

  • Modifies color parser in vis-core to support hex strings that are missing a hash
  • Fixes a bug on makeRGBAColorVector when normalized = false where color values weren't being normalized
  • Added tests to prove it works

How

  • Update Regex to have an optional # and add hash if it's missing from input
  • Pass normalized variable to makeRGBColorVector call in makeRGBAColorVector
  • Wrote tests for each scenario possible with the functions

PR Checklist

  • Is your PR title following our conventional commit naming recommendations?
  • Have you filled in the PR Description Template?
  • Is your branch up to date with the latest in main?
  • Do the CI checks pass successfully?
  • Have you smoke tested the example applications?
  • Did you check that the changes meet accessibility standards?
  • Have you tested the application on these browsers?
    • Chrome (Fully supported)
    • Firefox (Major bug fixes supported)
    • Safari (Major bug fixes supported)

@lanesawyer lanesawyer requested a review from a team as a code owner April 24, 2025 05:36

@TheMooseman TheMooseman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the tests!

@lanesawyer lanesawyer merged commit dd37dbd into AllenInstitute:main Apr 28, 2025
@lanesawyer lanesawyer deleted the lane/135-more-flexible-color-parser branch April 29, 2025 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OME-Zarr viewer doesn't work with hex code colors that don't start with #

2 participants